#include "../RealtimeUI/MPEGDecompress.hpp"
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <vector>

void Handle(const char* data,std::size_t size)
{
  std::cout<<size<<std::endl;
}

int main()
{
  gst_init(nullptr,nullptr);
  MPEG_Decompress decompress;
  std::ifstream imageRead("test.jpeg",std::ios::binary);
  if(!imageRead.is_open())
    throw;
  auto buf=imageRead.rdbuf();
  std::vector<char> fileData((std::istreambuf_iterator<char>(imageRead)),
                               std::istreambuf_iterator<char>());
  std::cout<<"Read Data Size : "<<fileData.size()<<std::endl;
  decompress.InputData(fileData.data(),fileData.size());
  while(sleep(10)==0)
    ;
}
